package main

import (
	"fmt"
	"reflect"
)

func main() {
	type A struct {
		A string
		B int
	}

	a := &A{}
	typeOf := reflect.ValueOf(a)
	if typeOf.Kind() == reflect.Ptr {
		fmt.Printf("value-elem：%+v\n", typeOf.Elem())
	}
	fmt.Printf("value-type：%+v\n", typeOf.Elem().Type())
	var a1 *A
	valueOfA1 := reflect.ValueOf(a1)
	fmt.Printf("value-nill：%+v\n", reflect.New(valueOfA1.Type().Elem()))
	fmt.Printf("value-nill：%+v\n", reflect.New(valueOfA1.Type().Elem()).Kind())
	fmt.Printf("value-nill：%+v\n", reflect.New(valueOfA1.Type().Elem()).IsNil())
}
